<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib tagdir="/WEB-INF/tags/" prefix="util" %>

<util:template titulo="Usuario">
    <div class="row">
        <div class="col-md-9 col-md-offset-3">
            <form role="form" method="post" name="form-grupo" action="intranet/departamento/confirmar">
                <div class="panel-heading">
                    <h1 class="panel-title"><c:if test="${not empty id}">Editar</c:if>
                        <c:if test="${empty id}">Adicionar</c:if> departamento</h1>
                </div>
                <div class="panel-body">
                    <c:if test="${not empty id}">
                        <input class="form-control" type="hidden" name="id" value="${id}">
                    </c:if>
                    <div class="row">
                        <div class="col-md-7">
                            <div class="form-group row">
                                <label for="nome" class="col-md-4 control-label">Nome</label>
                                <div class="col-md-3">
                                    <input type="text" class="form-control" id="nome" name="nome" maxlengh="40"
                                           value="${departamento.nome}"
                                           style="width:350px" placeholder="Informe o nome" required="true">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label for="descricao" class="col-md-4 control-label">Descri&ccedil;&atilde;o</label>
                                <div class="col-md-3">
                                    <input type="text" class="form-control" id="nome" name="descricao" maxlengh="40"
                                           value="${departamento.descricao}"
                                           style="width:350px" placeholder="Informe uma descrição">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label for="datacriacao" class="col-md-4 control-label">Data cria&ccedil;&atilde;o</label>
                                <div class="col-md-3">
                                    <input type="text" class="form-control"  name="datacriacao" maxlength="10"
                                           style="width:150px"
                                           placeholder="dd/mm/aaaa" required="true"
                                           value="<fmt:formatDate pattern="dd/MM/yyyy"
                                                           value="${departamento.dataCriacao}"/>"/>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label for="datadesativacao" class="col-md-4 control-label">Data desativa&ccedil;&atilde;o</label>
                                <div class="col-md-3">
                                    <input type="text" class="form-control"  name="datadesativacao" maxlength="10"
                                           style="width:150px"
                                           placeholder="dd/mm/aaaa"
                                           value="<fmt:formatDate pattern="dd/MM/yyyy"
                                                           value="${departamento.dataDesativacao}"/>"/>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-actions">
                        <button type="submit" class="btn btn-primary">Enviar</button>
                        <a class="btn btn-warning" href="${baseURL}/intranet/departamento/listar">Voltar</a>
                        <button type="reset" class="btn btn-default">Limpar</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</util:template>